<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:body>
	<p:dialog widgetVar="dlgCadSolicitaServico"
		header="Cadastro #{message.header_solicitacao_servico}" modal="true"
		width="500" draggable="false" style="font-size: 12px;">
		<h:form id="cadSSForm">
			<p:fieldset legend="Novo">
				<h:panelGrid columns="1">
					<h:outputLabel styleClass="LabelFont"
						value="#{message.solicita_filial}" />
					<p:selectOneMenu id="idFilial"
						value="#{solicitacaoManutencaoTela.solicitaManu.filial}"
						required="true" requiredMessage="#{message.msg_requerido}">
						<f:selectItem itemLabel="" itemValue="" />
						<f:selectItem itemLabel="Matriz" itemValue="01" />
						<f:selectItem itemLabel="Capivari" itemValue="02" />
						<f:selectItem itemLabel="Içara" itemValue="04" />
						<f:selectItem itemLabel="Criciúma" itemValue="06" />
						<f:selectItem itemLabel="Linha Leve" itemValue="09" />
						<f:selectItem itemLabel="Unidade 4" itemValue="14" />
						<f:selectItem itemLabel="Içara II" itemValue="16" />
						<p:ajax global="false" update="@form,:messages" />
					</p:selectOneMenu>


					<h:outputLabel styleClass="LabelFont" value="#{message.label_bem}" />
					<p:commandButton icon="ui-icon-search" title="Pesquisar"
						type="button" onclick="dlgConsultaBens.show()"
						disabled="#{solicitacaoManutencaoTela.solicitaManu.filial == null || (solicitacaoManutencaoTela.solicitaManu.filial.equals('') ? true : false)}">

						<p:autoComplete
							disabled="#{solicitacaoManutencaoTela.solicitaManu.filial == null || (solicitacaoManutencaoTela.solicitaManu.filial.equals('') ? true : false)}"
							value="#{solicitacaoManutencaoTela.solicitaManu.bemAtivo}"
							dropdown="true" size="50" id="inputBem"
							completeMethod="#{solicitacaoManutencaoTela.autoCompleteBemAtivo}"
							required="true" requiredMessage="#{message.msg_requerido}"
							maxResults="10" var="bem"
							itemLabel="#{bem.codigo} - #{bem.descricao}" itemValue="#{bem}"
							converter="bemAtivoConverter" forceSelection="true">


						</p:autoComplete>
					</p:commandButton>
					<h:outputLabel styleClass="LabelFont"
						value="#{message.label_tipo_servico}" />
					<p:autoComplete
						value="#{solicitacaoManutencaoTela.solicitaManu.tipoServico}"
						dropdown="true"
						completeMethod="#{solicitacaoManutencaoTela.autoCompleteTipoServico}"
						required="true" requiredMessage="#{message.msg_requerido}"
						var="tipo" itemLabel="#{tipo.codigo} - #{tipo.descricao}"
						itemValue="#{tipo}" converter="tipoServicoConverter"
						forceSelection="true" size="50" maxResults="5" />

					<h:outputLabel styleClass="LabelFont"
						value="#{message.label_tipo_manutencao}" />
					<p:selectOneMenu
						value="#{solicitacaoManutencaoTela.solicitaManu.tipoManutencao}"
						required="true" requiredMessage="#{message.msg_requerido}">
						<f:selectItem itemLabel="" itemValue="" />
						<f:selectItem itemLabel="Manutenção" itemValue="M" />
						<f:selectItem itemLabel="Ferramentaria" itemValue="F" />
						<f:selectItem itemLabel="Gabarito" itemValue="G" />
					</p:selectOneMenu>

					<h:outputLabel value="Ramal/Fone" styleClass="LabelFont" />
					<p:inputText
						value="#{solicitacaoManutencaoTela.solicitaManu.ramal}" size="10"
						required="true" requiredMessage="#{message.msg_requerido}" />

					<h:outputLabel value="#{message.label_descricao_servico}"
						styleClass="LabelFont" />
					<p:inputTextarea cols="50" required="true"
						requiredMessage="#{message.msg_requerido}"
						value="#{solicitacaoManutencaoTela.solicitaManu.descricaoServico}" />
				</h:panelGrid>

				<div style="margin-left: 130px; margin-top: 10px;">
					<p:commandButton value="#{message.botao_concluir}"
						icon="ui-icon-disk"
						actionListener="#{solicitacaoManutencaoTela.salvar}"
						update="@form,:messages,:dlgSucesoSolServ" />
					<p:commandButton value="#{message.botao_cancelar}" type="button"
						onclick="dlgCadSolicitaServico.hide()" icon="ui-icon-close" />
				</div>
			</p:fieldset>
		</h:form>
		<p:dialog header="Sucesso" widgetVar="dlgSucessoSolServ" modal="true"
			appendToBody="true" resizable="false">
			<h:form id="dlgSucesoSolServ">
				<h:panelGrid columns="1">
					<p:hotkey bind="esc" handler="dlgSol.hide()" />
					<h:outputText value="Solicitação Incluída."
						style="font-size: 16px;" />
					<h:outputText
						value="#{solicitacaoManutencaoTela.numeroSolicitacaoServico}"
						style="font-size: 16px; color:#CC3333; font-weight: bold;" />

				</h:panelGrid>
			</h:form>
		</p:dialog>
	</p:dialog>
</h:body>
</html>